﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using HA.Data;
namespace HA.ModFlow.Controls.Converts
{
    class LayerRangeConvert:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string str="";
            AutoAssignLayer auto =(AutoAssignLayer)value;
            switch (auto)
            {
                case  AutoAssignLayer.AutoAssignIncludingLowerCell :
                    str = "AutoAssignIncludingLowerCell";
                    break;
                case AutoAssignLayer.AutoAssignToOneCell:
                    str = "AutoAssignToOneCell";
                    break;
                case AutoAssignLayer.UseLayerRange:
                    str = "UseLayerRange";
                    break;
            }
            return str;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string str = (string)value;
            AutoAssignLayer auto = AutoAssignLayer.UseLayerRange;
            switch (str)
            {
                case "AutoAssignIncludingLowerCell":
                    auto = AutoAssignLayer.AutoAssignIncludingLowerCell;
                    break;
                case "AutoAssignToOneCell":
                    auto = AutoAssignLayer.AutoAssignToOneCell;
                    break;
                case "UseLayerRange":
                    auto = AutoAssignLayer.UseLayerRange;
                    break;
            }
            return auto;
        }
    }
}
